var a = getApp();

Page({
    data: {
        radUrl: "../../img/radn.png",
        radhUrl: "../../img/radh.png",
        itemClass: "item",
        choRedPacketId: ""
    },
    onLoad: function(t) {
        var e = this;
        e.setData({
            choRedPacketId: a.globalData.couponId
        }), wx.request({
            url: a.globalData.baseUrl + a.globalData.urlMyCoupon,
            data: {
                userId: a.globalData.userId
            },
            method: "POST",
            header: {
                "content-type": "application/x-www-form-urlencoded"
            },
            success: function(a) {
                var t = JSON.parse(a.data);
                e.setData({
                    coupon: t
                });
            }
        });
    },
    choRedPackets: function(t) {
        a.globalData.couponId = t.currentTarget.dataset.id;
        var e = getCurrentPages();
        e[e.length - 2].setData({
            redSum: t.currentTarget.dataset.value
        }), wx.navigateBack({
            delta: 1
        });
    },
    onShareAppMessage: function() {}
});